﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace BDSim
{
    public class PPositionDLL
    {
        [DllImport("PPositionDLL.dll", EntryPoint = "PonitPositioning", CallingConvention = CallingConvention.Cdecl)]
        private static extern int PonitPositioning(PPositionning_Input pParamInput, PPositionning_Param pControlParam,out PPositionning_Output pProcessOutput);

        /// <summary>
        /// 接收机定位，add by liuy on 20160801
        /// </summary>
        /// <param name="pParamInput">定位输入参数</param>
        /// <param name="pControlParam">定位控制参数</param>
        /// <param name="pProcessOutput">定位结果</param>
        /// <param name="type">定位算法类型</param>
        /// <returns></returns>
        public static int PPositioning(PPositionning_Input pParamInput, PPositionning_Param pControlParam, out PPositionning_Output pProcessOutput, EPositionType type)
        {
            int ret = -1;
            PPositionning_Output pProcessOutputTemp = new PPositionning_Output();

            switch (type)
            {
                case EPositionType.最小二乘法:
                    ret = PonitPositioning(pParamInput, pControlParam, out pProcessOutputTemp);
                    break;
                default:
                    break;
            }

            pProcessOutput = pProcessOutputTemp;

            return ret;
        }
    }
}
